package com.sline.ThreadMethod;

public class Demo4_Daemon {
    public static void main(String[] args) {
        Thread t1 = new Thread() {
            public void run() {
                for (int i = 0; i < 2; i++) {
                    System.out.println(this.getName() + "aaaaaaaaaaaaa");
                }
            }
        };
        Thread t2 = new Thread() {
            public void run() {
                for (int i = 0; i < 5000; i++) {
                    System.out.println(this.getName() + "bb" + i);
                }
            }
        };

        t2.setDaemon(true);
        t2.start();
        t1.start();
    }
}
